<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/12
  Time: 13:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set var="webroot" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>${title}</title>
    <script src="${webroot}/element/vue.js"></script>
    <link rel="stylesheet" href="${webroot}/element/index.css">
    <script src="${webroot}/element/index.js"></script>
    <link rel="stylesheet" type="text/css" href="${webroot}/styles/basc.css">
</head>

<body>
<div id="app">
    <%@ include file="../includes/hear.jsp" %>
    <div style="float: left;width: 200px;">
        <%@ include file="../includes/menu.jsp" %>
    </div>
    <div style="float: left;width: 800px;">
        <div class="operation" style="margin-left: 10px;margin-bottom: 10px;padding-top: 10px;"></span>
        </div>
        <el-form ref="form" :model="form" style="margin-left: 50px;"><span class="mess" id="tpess">${sessionScope.tpess}</span>
            <table>
                <tr>
                    <td>
                        <el-button type="primary" plain style="width: 100px;" @click="add()">登记录入</el-button>
                        <el-button type="primary" plain style="width: 100px;" @click="cx()">条件查询</el-button>
                        <%--                        <el-button type="primary" plain style="width: 100px;" @click="cx2()">查询全部</el-button>--%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <el-input v-model="form.pname" placeholder="商品名称" style="width: 150px;"></el-input>
                        <el-input v-model="form.starprice" placeholder="最小商品单价" style="width: 150px;"></el-input>
                        <el-input v-model="form.endprice" placeholder="最大商品单价" style="width: 150px;"></el-input>
                        <el-input v-model="form.pcount" placeholder="退货量" style="width: 150px;"></el-input>
                    </td>
                </tr>
            </table>
        </el-form>
        <table class="dt" border="0" cellspacing="1">
            <tr>
                <th>序号</th>
                <th>商品ID</th>
                <th>商品名称</th>
                <th>商品单价</th>
                <th>商品数量</th>
                <th>登记时间</th>
            </tr>
            <c:forEach items="${sessionScope.tufind.data}" var="record" varStatus="rows">
                <tr>
                    <td>${(tufind.pageNo-1)*tufind.pageSize+rows.count}</td>
                    <td>${record.gid}</td>
                    <td>${record.pname}</td>
                    <td>${record.price}</td>
                    <td>${record.pcount}</td>
                    <td>${record.ptime}</td>
                </tr>
            </c:forEach>
        </table>
        <div class="pagenav">${sessionScope.tufind.pageNav}</div>
    </div>
</div>
</body>
<STYLE>
    #app {
        width: 1280px;
        margin: 0 auto;
    }
</STYLE>
<script>
    new Vue({
        el: '#app',
        data: {
            form: {
                pname: '',
                starprice: '',
                endprice: '',
                pcount: '',
                group: '退货',
            }
        },
        methods: {
            cx() {
                var info = {
                    pname: this.form.pname,
                    starprice: this.form.starprice,
                    endprice: this.form.endprice,
                    pcount: this.form.pcount,
                    group: this.form.group,
                }
                window.location.href = "${webroot}/cg_manage/purchase.do?action=tfind&tinfo=" + JSON.stringify(info)
            },
            add() {
                window.location.href = '${webroot}/goGroup.do?action=退货';
            }
        },
    })
</script>
</html>
